package com.exam.common.api;

/**
 * @author wangwang
 * @date 2025/11/1 11:09
 */
public enum ResultCode implements IErrorCode{
    SUCCESS(0, "ok"),

    // 4xxx 客户端错误
    PARAM_ERROR(40001, "参数校验失败"),
    AUTH_FAILED(40002, "账号或密码错误"),
    UNAUTHORIZED(40003, "未登录或登录已过期"),
    FORBIDDEN(40004, "无权限"),
    NOT_FOUND(40400, "资源不存在"),
    CONFLICT(40900, "资源冲突"),
    // 5xxx 服务器错误
    FAILED(50000, "服务器内部错误");

    private final int code;
    private final String message;


    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }


    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
